<template>
	<view class="content">
		<textarea rows="15" v-model="content" placeholder="请填写您要反馈的问题"></textarea>
		<button class="new-btn" @click="submit">提交</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content: ''
			}
		},
		methods: {
			async submit() {
				if (!this.content) {
					this.$u.toast('你还没有填写意见哦');
					return false;
				}
				const {
					data: res
				} = await this.$Request({
					url: 'api/user/feedback',
					data: {
						user_id: this.$store.state.userid,
						content: this.content
					}
				})
				if (res && res.code == 200) {
					this.content = ''
					uni.showLoading({
						mask:true,
						title:'提交成功'
					})
					setTimeout(()=>{
						uni.navigateBack()
					},1500)
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		/* #ifndef H5 */
		min-height: 100vh;
		/* #endif */
		/* #ifdef H5 */
		min-height: calc(100vh - 44px);
		/* #endif */
		background-color: #2A2931;

		textarea {
			color: #fff;
			width: 100vw;
			padding: 20rpx 40rpx;
			box-sizing: border-box;
		}
	}
</style>
